EXPORTED_HEADERS = [
  'Inspector.h',
]

def library(**kwargs):
  if THIS_IS_FBANDROID:
    include_defs('//ReactAndroid/DEFS')

    cxx_library(
      force_static = True,
      # We depend on JSC, support the same platforms
      supported_platforms_regex = '^android-(armv7|x86)$',
      deps = [
        '//xplat/folly:molly',
        react_native_xplat_target('jschelpers:jschelpers'),
      ],
      **kwargs
    )
  elif THIS_IS_FBOBJC:
    ios_library(
      inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,
      frameworks = [
       '$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework',
      ],
      deps = [
        '//xplat/folly:molly',
        react_native_xplat_target('jschelpers:jschelpers'),
      ],
      **kwargs
    )
  else:
    raise Error('Unknown repo')

library(
  name = 'inspector',
  preprocessor_flags = [
    '-DENABLE_INSPECTOR=1',
  ],
  compiler_flags = [
    '-Wall',
    '-Wno-shadow',
    '-Wno-inconsistent-missing-override',
    '-Wno-unused-local-typedef',
    '-Wno-unused-private-field',
    '-Wno-undefined-bool-conversion',
    '-fexceptions',
    '-fvisibility=hidden',
    '-std=gnu++1y',
  ],
  exported_headers = EXPORTED_HEADERS,
  headers = subdir_glob([('inspector', '*.h')], excludes=EXPORTED_HEADERS),
  header_namespace = 'inspector',
  srcs = glob(['*.cpp']),
  visibility = [
    'PUBLIC',
  ],
)
